import requestProxy from '@/utils/request';
const { request } = requestProxy;

// 还款tab列表
export function tabList(params) {
  return request({
    url: '/admin/payBack/tab',
    method: 'get',
    params
  });
}
// 还款列表
export function payBackList(params, cancelToken) {
  return request({
    url: '/admin/payBack/list',
    method: 'get',
    params,
    cancelToken
  });
}
// 新建还款申请
export function payBackCreate(data) {
  return request({
    url: '/admin/payBack/create',
    method: 'post',
    data
  });
}
// 新建还款申请
export function payBackEdit(id, data) {
  return request({
    url: `/admin/payBack/edit/${id}`,
    method: 'put',
    data
  });
}
// 删除还款列表元素
export function deletePayBack(id) {
  return request({
    url: `/admin/payBack/delete/${id}`,
    method: 'delete'
  });
}
// 编辑还款说明
export function descriptionEdit(data) {
  return request({
    url: 'admin/payBack/descriptionEdit',
    method: 'put',
    data
  });
}
// 获取还款详情信息
export function payBackInfo(id) {
  return request({
    url: `admin/payBack/detail/${id}`,
    method: 'get'
  });
}
// 还款评论列表
export function payBackComments(params) {
  return request({
    url: '/admin/payBack/comments/list',
    method: 'get',
    params
  });
}
// 还款发表评论
export function payBackCommentAdd(data) {
  return request({
    url: '/admin/payBack/comments/add',
    method: 'post',
    data
  });
}
// 还款申请-流程审批
export function payBackProcessAudit(data) {
  return request({
    url: '/admin/payBack/process/audit',
    method: 'post',
    data
  });
}
// 还款申请 - 流程 - 撤回
export function payBackProcessRecall(data) {
  return request({
    url: '/admin/payBack/process/recall',
    method: 'post',
    data
  });
}
// 还款申请 - 流程 - 撤销
export function payBackProcessRevocation(data) {
  return request({
    url: '/admin/payBack/process/revocation',
    method: 'post',
    data
  });
}
// 表单提交、获取审批流
export function formSubmit(data) {
  return request({
    url: '/admin/payBack/formSubmit',
    method: 'post',
    data
  });
}
// 用户借款信息
export function getUsrFinancial(params) {
  return request({
    url: '/admin/user/financial/info',
    method: 'get',
    params
  });
}
// 订单列表-统计数据
export function getStatistics(params) {
  return request({
    url: 'admin/payBack/list/statistics',
    method: 'get',
    params
  });
}
